package work;

import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;

public class Test {
    public static void main(String[] args)  {
        String str="字符串与字节互转";
        byte[] bytes=str.getBytes(StandardCharsets.UTF_8);
        try {
            String s=new String(bytes,"utf-8");
            System.out.println(s);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }


    }
}
